﻿@model WebUI.Models.Catalog
@{ var tm = Model.QizTemplates.FirstOrDefault(); tm = tm != null ? tm : new WebUI.Models.QizTemplate();}
<div>
    <h3>
        分类[ @Model.Title ] @Ajax.ActionLink("删除", "DelSuiFangTemplateForm", new { ID = Model.CatalogID }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "SuiFangTemplateFormView", HttpMethod = "Post", InsertionMode = InsertionMode.Replace, OnSuccess = "$('#sftt" + Model.CatalogID + "').remove()", OnFailure = "OnSiteError", Confirm = OnConfirmDel() })
    </h3>
    @using (Ajax.BeginForm("CreateSuiFangTemplateForm", new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "sftt" + Model.CatalogID, HttpMethod = "Post", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" }))
    {
        <nobr>
        @Html.Hidden("TreeID", Model.CatalogID)
        @Html.TextBox("NewName")
        <a href="#" onclick="$(this).parents('form:first').submit();return(false);"><input style="display:none" type="submit" value="新建" />添加</a>
        </nobr>
    }
</div>
<h3>
    随访项</h3>
@Ajax.ActionLink("添加", "SuiFangTemplateItem", new { SuiFangTemplateID = Model.CatalogID }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "dialogbox", OnComplete = "showDialog('随访项');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
<table class="width">
    <tr>
        <th>@Html.LabelFor(model => tm.Title)
        </th>
        <th>@Html.LabelFor(model => tm.StatusRef)
        </th>
        <th>@Html.LabelFor(model => tm.Department)
        </th>
        <th>
            操作
        </th>
    </tr>
    @foreach (var item in Model.QizTemplates)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.StatusRef.OptionTitle)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Department.DepName)
            </td>
            <td width="100px">
                @Ajax.ActionLink("修改", "SuiFangTemplateItem", new { ID = item.QizFormTemplateID }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "dialogbox", OnComplete = "showDialog('随访项');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })|
                @Ajax.ActionLink("删除", "DelSuiFangTemplateItem", new { ID = item.QizFormTemplateID }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "SuiFangTemplateFormView", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError", Confirm = OnConfirmDel() })|
                @Ajax.ActionLink("明细", "SftMingXiMgr", new { ID = item.QizFormTemplateID }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "SuiFangTemplateFormView", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
            </td>
        </tr>
    }
</table>
@Html.Partial("TrHilighter")